-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add KIP-10 Mutual Transaction Opcodes and Hard Fork Support #487
Open
biryukovmaxim
wants to merge
28
commits into
kaspanet:master
Choose a base branch
from
biryukovmaxim:kip-10-mutual-tx
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
biryukovmaxim
force-pushed
the
kip-10-mutual-tx
branch
from
June 16, 2024 11:55
0506248
to
ff25568
Compare
biryukovmaxim
force-pushed
the
kip-10-mutual-tx
branch
from
June 16, 2024 11:59
f0da1c1
to
f7a3f77
Compare
add ci cd test
# Conflicts: # consensus/src/processes/transaction_validator/transaction_validator_populated.rs # crypto/txscript/Cargo.toml
- Add threshold_scenario_limited_one_time function - Add threshold_scenario_limited_2_times function - Create generate_limited_time_script for reusable script generation - Implement nested script structure for two-times borrowing - Update documentation for both scenarios - Add tests for owner spending, borrowing, and invalid attempts in both cases - Ensure consistent error handling and logging across scenarios - Refactor to use more generic script generation approach
biryukovmaxim
force-pushed
the
kip-10-mutual-tx
branch
from
October 15, 2024 10:39
aeb5b95
to
e5e8b64
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces four new opcodes to the Kaspa scripting language:
OpInputSPK
,OpOutputSpk
,OpInputAmount
, andOpOutputAmount
. These additions require a hard fork. The new opcodes are specifically designed to support KIP-10 mutual transactionsFeatures
OpInputSpk
: Retrieves the script public key of the input.OpOutputSpk
: Retrieves the script public key of the output.OpInputAmount
: Retrieves the amount of the input.OpOutputAmount
: Retrieves the amount of the output.Example Usage
The example provided demonstrates common logic that should be used with the new opcodes. The script allows for two main scenarios:
input + threshold
and goes to the P2SH of the script itself. This scenario also includes a check where the threshold is not reached, demonstrating the validation of input and output values.For detailed code, refer to the example
Motivation
The introduction of these new opcodes and the hard fork support enhances the flexibility and functionality of the Kaspa scripting language.
These changes are part of the implementation of the KIP-10 proposal.
For more information, refer to the KIP-10 research document.